package com.fresh.everynew.kotlin

import org.junit.jupiter.api.Test

//@SpringBootTest
class FreshKotlinApplicationTests {

    @Test
    fun contextLoads() {
//        println(old(1,2))
//        new(4,5)
//        vars(1,2,3,4,5)
        val unlambda:(Int, Int)->Int = { a, b->a+b}
        println(unlambda(1,2))
        var age: String? = null
        val ages = age?.toInt()
        val ages1 = age?.toInt()
        val ages2 = ages?.toInt() ?:-1
        println(ages)
        println(ages1)
        println(ages2)
    }
    fun old(a:Int , b:Int): Int = a+b
    fun new(a:Int, b:Int): Unit = println(a+b)
    fun vars(vararg v:Int) {
        for(item in v){
            println(item);
        }
    }
}
